package vip.xiaonuo.biz.modular.event.util;

public class EventActionUtil {

    /**
     * 获取接口动作名称
     * @param reqType
     * @return
     */
    public static String getApiAction(Integer reqType){
        switch (reqType) {
            case 1:
                return "开柜门";
            case 2:
                return "关柜门";
            case 3:
                return "手动盘库";
            case 4:
                return "自动盘库";
            case 5:
                return "柜子重启";
            case 6:
                return "离线上报";
            case 7:
                return "根据卡号获取用户信息";
            case 8:
                return "根据卡号获取柜门操作权限";
            case 9:
                return "获取指定柜所有柜门权限";
            case 10:
                return "webhook事件";
            case 11:
                return "称重";
            case 97:
                return "扫码入库";
            case 96:
                return "扫码借出";
            case 95:
                return "扫码归还";
            default:
                return "未知动作";
        }
    }

    /**
     * 获取事件动作名称
     * 接口类型 => 事件动作 转换
     * @param reqType
     * @return
     */
    public static Integer getEventAction(Integer reqType) {
        switch (reqType) {
            case 1:
                return 2;
            case 2:
                return 3;
            case 3:
                return 4;
            case 4:
                return 5;
            case 5:
                return 6;
            case 8:
                return 1;
            case 10:
                return 9;
            case 11:
                return 10;
            case 97:
                return 11;
            case 96:
                return 12;
            case 95:
                return 13;
            default:
                return 0;
        }
    }
}
